<template>
  <div class="modern-page error-page">
    <div class="error-content modern-card modern-slide-in">
      <div class="error-icon modern-float">
        <component :is="'ErrorCircleIcon'" />
      </div>
      <div class="error-code modern-text-gradient">404</div>
      <div class="error-title">页面不存在</div>
      <div class="error-description">
        抱歉，您访问的页面不存在或已被删除
      </div>
      <div class="error-actions">
        <t-button 
          theme="primary" 
          size="large"
          class="modern-btn-enhance"
          @click="goHome"
        >
          <template #icon>
            <component :is="'HomeIcon'" />
          </template>
          返回首页
        </t-button>
        <t-button 
          variant="outline" 
          size="large"
          @click="goBack"
        >
          <template #icon>
            <component :is="'ChevronLeftIcon'" />
          </template>
          返回上页
        </t-button>
      </div>
    </div>
  </div>
</template>

<script setup>
import { useRouter } from 'vue-router'

const router = useRouter()

const goHome = () => {
  router.push('/dashboard')
}

const goBack = () => {
  router.go(-1)
}
</script>

<style lang="scss" scoped>
.error-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}

.error-content {
  text-align: center;
  padding: 3rem 2rem;
  max-width: 500px;
  margin: 0 auto;
}

.error-icon {
  font-size: 4rem;
  color: #ef4444;
  margin-bottom: 1.5rem;
}

.error-code {
  font-size: 7.5rem;
  font-weight: 800;
  line-height: 1;
  margin-bottom: 1.25rem;
  letter-spacing: -0.05em;
}

.error-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--modern-text-primary);
  margin-bottom: 0.75rem;
}

.error-description {
  font-size: 1rem;
  color: var(--modern-text-muted);
  margin-bottom: 2rem;
  line-height: 1.6;
}

.error-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

:deep(.t-button) {
  border-radius: var(--modern-radius-md);
  height: 3rem;
  padding: 0 1.5rem;
  font-weight: 600;
  transition: var(--modern-transition-normal);
}

:deep(.t-button--theme-primary) {
  background: var(--modern-gradient-primary);
  border: none;
}

:deep(.t-button--theme-primary:hover) {
  background: var(--modern-gradient-secondary);
  transform: translateY(-2px);
  box-shadow: var(--modern-shadow-lg);
}

:deep(.t-button--variant-outline) {
  border: 2px solid rgba(0, 0, 0, 0.1);
  background: var(--modern-glass-bg-light);
  backdrop-filter: var(--modern-blur-sm);
}

:deep(.t-button--variant-outline:hover) {
  background: var(--modern-glass-bg);
  transform: translateY(-2px);
  box-shadow: var(--modern-shadow-md);
}

// 响应式设计
@media (max-width: 640px) {
  .error-content {
    padding: 2rem 1.5rem;
  }
  
  .error-code {
    font-size: 5rem;
  }
  
  .error-actions {
    flex-direction: column;
    align-items: center;
    
    :deep(.t-button) {
      min-width: 200px;
    }
  }
}
</style>
